package com.finance.capacity.formulaSet.capService;

import com.finance.capacity.formulaSet.bean.pojo.CapDxCoefficient;
import com.finance.capacity.formulaSet.bean.pojo.CapDxCoefficientList;
import com.finance.capacity.formulaSet.capDao.FormulaSetMapper;
import com.finance.framework.lang.Page;
import com.finance.framework.lang.PageResultBO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Author: gly
 * @Date: Created in 2017-09-20
 */
@Service
public class FormulaSetService implements IFormulaSetService {
    @Autowired
    private FormulaSetMapper formulaSetMapper;
    @Override
    public PageResultBO<CapDxCoefficientList> formulaSetListByPage(Page page) {
        PageResultBO<CapDxCoefficientList> pageResultBO = new PageResultBO<CapDxCoefficientList>();
        List<CapDxCoefficientList> capDxCoefficientLists = formulaSetMapper.formulaSetListByPage(page);
        pageResultBO.setPageNo(page.getPageNo());
        pageResultBO.setPageSize(page.getPageSize());
        pageResultBO.setTotalRecord(page.getTotalRecord());
        pageResultBO.setDataList(capDxCoefficientLists);
        return pageResultBO;
    }

    @Override
    public Boolean update(CapDxCoefficient capDxCoefficient) {
        return formulaSetMapper.update(capDxCoefficient)==1;
    }

    @Override
    public CapDxCoefficient getById(String id) {
        return formulaSetMapper.getById(id);
    }
}
